<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">
<body>
<div style="background-color:#404040">
<h1 style="text-align:center;"> 
		<img border="10" src="images/banner.jpg" height="200" width="800" alt="dupas"/>

	</h1>
	
	<div style="background-color:#888888;text-align:center ;position:relative; top:0px; height:50px; width:100%; border-style: solid; border-width: 2px;">
		<h:form id="logIn" rendered="#{!userBean.logged}">
			<h:outputLabel>Login</h:outputLabel>
			<h:inputText id="login" value="#{userBean.login}" required="true" requiredMessage="Please insert login"/>
			<h:message for="login" style="color:red;"/>
			
			<h:outputLabel>Password</h:outputLabel>
			<h:inputSecret id="password" value="#{userBean.password}" required="true" requiredMessage="Please insert password"/>
			<h:message for="password" style="color:red;"/>

			<h:commandButton value="LogIn" action="#{userBean.logIn}"/>
			<a href="register.xhtml">Register</a>
		</h:form>
		<h:form id="logOut" rendered="#{userBean.logged}">
			<h:outputLabel value="#{userBean.login} logged in "></h:outputLabel>
			<h:commandButton value="LogOut" action="#{userBean.logOut}" />
			
		</h:form>
		<h:messages globalOnly="true" layout="table"/>
		<h:message for="logIn"/>
	</div>
	<div style="background-color:#888888; height:300px; width:150px; float:left; border-style: solid; border-width: 2px;  ">
	<h:panelGroup rendered="#{userBean.user.type == 'Administration' || userBean.user.type == 'Technical service'}">
		<a href="addStadium.xhtml" >Add new stadium</a>
		<br/>
		<a href="addGame.xhtml">Add new Game</a>
		<br/>
	</h:panelGroup>
	<h:panelGroup rendered="#{userBean.user.type == 'Administration'}">
		<a href="adminPane.xhtml">Administration panel</a>
	</h:panelGroup>
	
	<a href="searchGame.xhtml">Search for a Game</a>
	<br/>
	<a href="cart.xhtml">My cart</a>

	</div>
	</div>

</body>
</html>
